package cn.tsvtc.shop.mapper;


import cn.tsvtc.shop.pojo.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
public interface UserMapper {


    /**
     * 增加
     * @param user
     * @return
     */
    int insert(User user);

    /**
     * 根据手机查询用户
     * @param phone
     * @return
     */
    User findByPhone(String phone);

    /**
     * 根据邮箱查询用户
     * @param email
     * @return
     */
    User findByEmail(String email);


    /**
     * 更新
     * @param user
     * @return
     */
    int updateByPrimaryKeySelective(User user);

    /**
     * 获取全部用户
     * @return
     */
    @Select("select * from t_user")
    List<User> selectAll();
}